package es.deusto.eside.programacion4.mario2d.model;

import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;

/**
 * Proyectil
 * 
 * @author Sergio
 * 
 */
public class Proyectile {

	/**
	 * Imagen
	 */
	Image proyectile;
	/**
	 * Posicion X
	 */
	int positionx;

	/**
	 * Posicion y
	 */
	int positionY;
	/**
	 * ultima posicion
	 */
	int lastPosition;
	/**
	 * Indica si se puede disparar
	 */
	boolean canBeShooted, isItShooted, firstime = true;

	/**
	 * Constructor
	 * 
	 * @param x
	 * @param y
	 */
	public Proyectile(int x, int y) {
		try {
			proyectile = new Image("resources/Images/fireBall.png");
		} catch (SlickException e) {
			e.printStackTrace();
		}
		proyectile = proyectile.getScaledCopy(10, 10);
		this.positionx = x;
		this.positionY = y;
		this.lastPosition = x + 50;
		canBeShooted = true;
		isItShooted = false;
	}

	/**
	 * @return the firstime
	 */
	public boolean isFirstime() {
		return firstime;
	}

	/**
	 * @param firstime
	 *            the firstime to set
	 */
	public void setFirstime(boolean firstime) {
		this.firstime = firstime;
	}

	/**
	 * @return the isItShooted
	 */
	public boolean isItShooted() {
		return isItShooted;
	}

	/**
	 * @param isItShooted
	 *            the isItShooted to set
	 */
	public void setItShooted(boolean isItShooted) {
		this.isItShooted = isItShooted;
	}

	/**
	 * @return the canBeShooted
	 */
	public boolean isCanBeShooted() {
		return canBeShooted;
	}

	/**
	 * @param canBeShooted
	 *            the canBeShooted to set
	 */
	public void setCanBeShooted(boolean canBeShooted) {
		this.canBeShooted = canBeShooted;
	}

	/**
	 * @return the lastPosition
	 */
	public int getLastPosition() {
		return lastPosition;
	}

	/**
	 * @param lastPosition
	 *            the lastPosition to set
	 */
	public void setLastPosition(int lastPosition) {
		this.lastPosition = lastPosition;
	}

	/**
	 * @return the proyectile
	 */
	public Image getProyectile() {
		return proyectile;
	}

	/**
	 * @param proyectile
	 *            the proyectile to set
	 */
	public void setProyectile(Image proyectile) {
		this.proyectile = proyectile;
	}

	/**
	 * @return the positionx
	 */
	public int getPositionx() {
		return positionx;
	}

	/**
	 * @param positionx
	 *            the positionx to set
	 */
	public void setPositionx(int positionx) {
		this.positionx = positionx;
	}

	/**
	 * @return the positionY
	 */
	public int getPositionY() {
		return positionY;
	}

	/**
	 * @param positionY
	 *            the positionY to set
	 */
	public void setPositionY(int positionY) {
		this.positionY = positionY;
	}
}
